import request from '@/untils/request.js'
//文章分类列表查询
export const articleCategoryService = () => {

    //const tokenStore = useTokenStore()
    //在pinia中定义响应式数据都不需要.value
    //return request.get('/category', { headers: { 'Authorization': tokenStore.token } })
    return request.get('/category')
}

//添加文章分类接口
export const addArticleCategoryService = (categoryData) => {

    return request.post('/category', categoryData)
}

//更新文章分类接口
export const updateArticleCategoryService = (categoryData) => {
    return request.put('/category', categoryData)
}

//删除文章分类
export const deleteArticleCategoryService = (id) => {
    return request.delete('/category?id=' + id)
}


//获取文章列表条件分页
export const getArticleListService = (params) => {
    return request.get('/article', { params: params })
}

//添加文章
export const addArticleService = (articleData) => {
    return request.post('/article', articleData)
}

//修改文章
export const updateArticleService = (articleData) => {
    return request.put('/article', articleData)
}

//删除文章
export const deleteArticleService = (id) => {
    request.delete('/article?id=' + id)
}